home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
mac
/
LOGIC Apple II 5.25" Library - ProDOS
/
PRO001.dsk
/
FIN
/
INVESTMENT.ANAL.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
6KB
|
142 lines
1 HOME : PRINT : PRINT : PRINT : PRINT : PRINT : PRINT : PRINT "COMMON BASIC PROGRAMS--VOL.1"
2 PRINT : PRINT "ADAPTED FOR THE APPLE II BY JOSEPH BOLUS"
3 PRINT "FEB.9,1978": FOR I6 = 1 TO 5000: NEXT I6
10 DEF FN A(A) = INT(A *100 +.5)/100
20 HOME
30 PRINT "** INVESTMENTS,ANNUITY,AND FORECASTS **"
40 PRINT : PRINT
50 PRINT "1. FUTURE VALUE OF AN INVESTMENT": PRINT
60 PRINT "2. ANNUITY": PRINT
70 PRINT "3. REGULAR DEPOSITS": PRINT
80 PRINT "4. REGULAR WITHDRAWALS FROM INVESTMENTS": PRINT
90 PRINT "5. INITIAL INVESTMENT ": PRINT
100 PRINT "6. NOMINAL INTEREST RATE ON INVESTMENTS": PRINT
110 PRINT "7. FORECASTS (TREND LINE)": PRINT
120 PRINT "8. QUIT"
130 PRINT : PRINT : INPUT "WHICH? ";RE%
135 IF RE% <0 THEN 10
140 ON RE% GOTO 1000,2000,3000,4000,5000,6000,7000,8000
150 GOTO 10
1000 HOME
1010 PRINT TAB( 2);" "
1015 PRINT CHR$(7); CHR$(7); CHR$(7);
1020 PRINT "*** FUTURE VALUE OF AN INVESTMENT ***"
1025 PRINT : PRINT
1030 PRINT CHR$(7);: INPUT "INITIAL INVESTMENT? ";P
1050 PRINT CHR$(7);: INPUT "NOMINAL INTEREST RATE? ";I
1070 PRINT CHR$(7);: INPUT "NUMBER OF COMPOUNDING PERIODS/YR.? ";N
1080 PRINT CHR$(7);: INPUT "NUMBER OF YEARS? ";Y
1110 I = I/N/100
1120 T = P *(1 +I) ^(N *Y)
1125 PRINT : PRINT : POKE 50,63
1128 A = T:A = FN A(T)
1130 PRINT "FUTURE VALUE = $";A: PRINT : POKE 50,255
1140 INPUT "MORE DATA? ";RE$: IF RE$ = "Y" OR RE$ = "YES" THEN 1000
1150 GOTO 10
2000 HOME
2010 PRINT CHR$(7); CHR$(7); CHR$(7);: PRINT TAB( 2);" "
2015 PRINT TAB( 16);"ANNUITY"
2020 PRINT : PRINT
2030 PRINT CHR$(7);: INPUT "AMOUNT OF REGULAR DEPOSITS? ";R
2050 PRINT CHR$(7);: INPUT "NOMINAL INTEREST RATE? ";I
2070 PRINT CHR$(7);: INPUT "NUMBER OF DEPOSITS/YR.? ";N
2090 PRINT CHR$(7);: INPUT "NUMBER OF YEARS? ";Y
2110 I = I/N/100
2120 T = R *((1 +I) ^(N *Y) -1)/I
2125 A = T:A = FN A(A): POKE 50,63: PRINT
2130 PRINT "FUTURE VALUE = $";A: POKE 50,255: PRINT : PRINT
2150 INPUT "MORE DATA? ";RE$: IF RE$ = "Y" OR RE$ = "YES" THEN 2000
2160 GOTO 10
3000 HOME
3005 PRINT CHR$(7); CHR$(7); CHR$(7)
3010 PRINT TAB( 12);"REGULAR DEPOSITS": PRINT : PRINT
3030 PRINT CHR$(7);: INPUT "NUMBER OF YEARS? ";Y
3050 PRINT CHR$(7);"TOTAL VALUE DESIRED IN ACCOUNT AFTER ";Y;: INPUT " YEARS? ";T
3055 PRINT CHR$(7);
3060 INPUT "NOMINAL INTEREST RATE? ";I
3070 PRINT CHR$(7);: INPUT "NUMBER OF DEPOSITS/YR.? ";N
3110 I = I/N/100
3120 R = T *I/((I +1) ^(N *Y) -1)
3125 PRINT : PRINT : POKE 50,63
3128 A = R:A = FN A(A)
3130 PRINT "REGULAR DEPOSITS =$";A: PRINT : PRINT : POKE 50,255
3140 INPUT "MORE DATA? ";RE$: IF RE$ = "Y" OR RE$ = "YES" THEN 3000
3150 GOTO 10
4000 HOME
4010 PRINT CHR$(7); CHR$(7); CHR$(7): PRINT " REGULAR WITHDRAWALS FROM AN INVESTMENT"
4020 PRINT : PRINT
4030 PRINT CHR$(7);: INPUT "INITIAL INVESTMENT? ";P
4050 PRINT CHR$(7);: INPUT "NOMINAL INTEREST RATE? ";I
4060 PRINT CHR$(7);: INPUT "NUMBER OF WITHDRAWALS/YR.? ";N
4070 PRINT CHR$(7);: INPUT "NUMBER OF YEARS? ";Y
4110 I = I/N/100
4120 R = P *(I/((1 +I) ^(N *Y) -1) +I)
4125 PRINT : PRINT : POKE 50,63
4128 A = R:A = FN A(A)
4130 PRINT "AMOUNT OF EACH WITHDRAWAL = $";A
4140 POKE 50,255: PRINT : PRINT
4150 INPUT "MORE DATA? ";RE$: IF RE$ = "Y" OR RE$ = "YES" THEN 4000
4160 GOTO 10
5000 HOME
5005 PRINT CHR$(7); CHR$(7); CHR$(7);
5010 PRINT : PRINT TAB( 11);"INITIAL INVESTMENT"
5020 PRINT : PRINT
5025 PRINT CHR$(7);
5030 INPUT "NUMBER OF YEARS? ";Y
5040 PRINT CHR$(7);: PRINT "TOTAL VALUE DESIRED AFTER ";Y: INPUT "YEARS? ";T
5050 PRINT CHR$(7);: INPUT "NUMBER OF COMPOUNDING PERIODS/YR.? ";N
5060 PRINT CHR$(7);: INPUT "NOMINAL INTEREST RATE? ";I
5070 PRINT : PRINT
5100 I = I/N/100
5120 P = T/(1 +I) ^(N *Y)
5125 POKE 50,63:A = P:A = FN A(A)
5130 PRINT "INITIAL INVESTMENT = $";A
5140 POKE 50,255: PRINT : PRINT
5150 INPUT "MORE DATA? ";RE$: IF RE$ = "Y" OR RE$ = "YES" THEN 5000
5160 GOTO 10
6000 HOME
6005 PRINT CHR$(7); CHR$(7); CHR$(7)
6010 PRINT " NOMINAL INTEREST RATE ON INVESTMENTS"
6020 PRINT : PRINT
6030 PRINT CHR$(7);: INPUT "PRINCIPLE? ";P
6040 PRINT CHR$(7);: INPUT "TOTAL VALUE? ";T
6050 PRINT CHR$(7);: INPUT "NUMBER OF YEARS? ";Y
6060 PRINT CHR$(7);: INPUT "NO. OF COMPOUNDING PERIODS/YR.? ";N
6070 PRINT : PRINT
6110 I2 = N *((T/P) ^(1/(N *Y)) -1) *100
6120 POKE 50,63:A = I2:A = FN A(A)
6130 PRINT "NOMINAL INTEREST RATE =";A;"%"
6140 PRINT : PRINT : POKE 50,255
6150 INPUT "MORE DATA? ";RE$: IF RE$ = "Y" OR RE$ = "YES" THEN 6000
6160 GOTO 10
7000 HOME
7005 PRINT CHR$(7); CHR$(7); CHR$(7)
7010 PRINT TAB( 9) ;"FORECASTS (TREND LINE)"
7020 PRINT : PRINT
7030 INPUT "NUMBER OF KNOWN POINTS? ";N: PRINT
7035 IF N <2 THEN 7037
7036 GOTO 7040
7037 PRINT "YOU MUST USE AT LEAST 2 POINTS": FOR I9 = 1 TO 2000: NEXT I9: GOTO 7000
7040 J = 0:K = 0:L = 0:M = 0:R2 = 0
7100 FOR I = 1 TO N
7110 PRINT "X,Y OF POINT? ";I;: INPUT X,Y
7130 J = J +X:K = K +Y:L = L +X ^2:M = M +Y ^2:R2 = R2 +X *Y
7155 PRINT CHR$(7); CHR$(7);
7180 NEXT I
7190 B = (N *R2 -K *J)/(N *L -J ^2):A = (K -B *J)/N
7230 J = B *(R2 -J *K/N):M = M -K ^2/N:K = M -J:R2 = J/M
7240 HOME
7250 PRINT "READY TO START FORECASTING..."
7255 CR = SQR(R2):CR = CR *100:CR = FN A(CR)
7260 PRINT "GOODNESS OF FIT IS ";CR;"%"
7270 POKE 34,5: POKE 35,23
7280 PRINT "FORECASTING (ENTER X=0 TO QUIT)": PRINT
7300 INPUT "X =? ";X: IF X = 0 THEN 7500
7310 POKE 50,63
7315 Y2 = A +B *X:Y2 = FN A(Y2)
7320 PRINT "Y =";Y2: PRINT : POKE 50,255
7330 GOTO 7300
7500 TEXT
7510 GOTO 10
8000 HOME
8010 END